import { useState } from 'react'

export const day01_07 = () => {
    const [count, setCount] = useState(0)
    const handleClick = () => {
        /* 
            作用:
                1.用传入的新值修改count
                2.重新使用新的count渲染UI
        */
        setCount(count + 1)
    }
    return (
        <div>
            <h3>07_useState基础使用</h3>
            <div>
                <button onClick={handleClick}>count: {count}</button>
            </div>
        </div>
    )
}
